package dao;

import beans.Group;
import db.DBQuery;

import java.util.List;

public class GroupDAO extends CommonDAO<Group> {

    public final static GroupDAO ME = new GroupDAO();

    @Override
    protected String tableName() {
        return "wb_group";
    }

    public List<Group> getUserGroupList(long user_id) {
        String sql = "select * from wb_group where id in (select group_id from wb_user_group_relation where user_id = ?)";
        return DBQuery.query_list(Group.class, sql, user_id);
    }
}
